using System;

namespace Mitosoft.Definitions.Logging
{
    /// <summary>
    /// Interface used from object which are able to handle log entry requests.
    /// </summary>
    public interface ILogSupplier
    {
        /// <summary>
        /// Adds the given log entry requester to the internal collection.
        /// So when the requester requests a log entry, the log entry
        /// will be saved to the file.
        /// </summary>
        /// <param name="logEntryRequester">Object implementing <see cref="ILogable"/></param>
        void AddLogEntryRequester(ILogable logEntryRequester);

        /// <summary>
        /// Creates a text line build by the given parameters and
        /// saves the text.
        /// </summary>
        /// <param name="source">Represents the name of the source which
        /// has requested the log entry.</param>
        /// <param name="message">Represents the message which should be saved
        /// in the log file.</param>
        /// <param name="ex">Represents the exception which should be stored
        /// in the log file. The exception may also be null.</param>
        void SaveLogEntry(string source, string message, Exception ex);
    }
}
